package edu.upc.viajes.domain;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Set;
import edu.upc.viajes.domain.Perfil;
import java.util.HashSet;
import javax.persistence.ManyToMany;
import javax.persistence.CascadeType;

@RooJavaBean
@RooToString
@RooEntity
public class Usuario {

    @NotNull
    @Size(max = 10)
    private String usu_cod;

    @NotNull
    @Size(max = 50)
    private String usu_nom;

    @NotNull
    @Size(max = 50)
    private String usu_direc;

    @NotNull
    @Size(max = 50)
    private String usu_car;

    @NotNull
    @Size(max = 50)
    private String usu_mail;

    @NotNull
    @Size(max = 50)
    private String usu_login;

    @NotNull
    @Size(max = 50)
    private String usu_passw;

    private Number usu_telef;

    @ManyToMany(cascade = CascadeType.ALL)
    private Set<Perfil> Perfil = new HashSet<Perfil>();
}
